<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Ingredients Overview</title>
</head>
<body>
    <h1>Ingredients</h1>
    <h2><a href="/webshop/admin/ingredients/add">Add Ingredient</a></h2>
    <h2>Current Ingredients</h2>
    <table border="1">
        <thead>
            <tr>
                <th>Description</th>
                <th>Amount</th>
                <th>Unit</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            <c:forEach var="ing" items="${ingredients}">
                <tr>
                    <td>${ing.designation}</td>
                    <td>${ing.amount}</td>
                    <td>${ing.unit}</td>
                    <td style="clear: both;">
                        <form action="/webshop/admin/ingredients/edit" method="GET" style="float: left;" >
                            <input type="hidden" name="ingredientId" value="${ing.id}" />
                            <input type="Submit" value="Edit" />
                        </form>
                        <form action="/webshop/admin/ingredients/remove" method="GET" style="float: left;">
                            <input type="hidden" name="ingredientId" value="${ing.id}" />
                            <input type="Submit" value="Remove" />
                        </form>
                        <!-- <a href="/webshop/admin/ingredients/edit?ingredientId=${ing.id}"><button>Edit</button></a>
                        <a href="/webshop/admin/ingredients/remove?ingredientId=${ing.id}"><button>Remove</button></a> -->
                    </td>
                </tr>
            </c:forEach>
        </tbody>
    </table>
    <br />
    <a href="/webshop">Back</a>
</body>
</html>